/**
 * parameter.h
 *
 *  Created on: May 9, 2018
 *      Author: geoff
 */

#ifndef SRC_PARAMETER_H_
#define SRC_PARAMETER_H_

namespace rmd {
enum { kInputLimit = 0, kError = 1 } KLimitType;

// define const
const double kPI = 3.141592654;
const long kUnknowValue = 4294967295;
const short kMaxChar = 256;

const short kSrcImageHeight = 540;//1080;//540;//
const short kSrcImageWidth = 960;//1920;//960;//
const short kImageHeight = 540;
const short kImageWidth = 600;

//auto
const short kUpdateGap = 20;
const short kAutoFrameGap = 2;
const short kStableNum = 5;

// roi
const short kRoiHeight = 160;
const short kRoiWidth = 400;
const short kRoiOffset = 30;
const short kRoiMinHeight = 100;
const short kRoiMinWidth  = 200;
const float kMaxWidthScale = 0.7;
const float kMinWidthScale = 0.2;

const short kCurrentLineIndexLeft = 1;
const short kCurrentLineIndexRight = 2;
const short kCurrentLineIndexLeftAndRight = 3;
const short kLineStableValue = 100;
const short kQualityLimit = 20;

// vanish point
const short kVanishPointLengthX = 80;
const short kVanishPointLengthY = 100;

// feature
const short kFeatureUpLaneInterval = 130;
const short kFeatureDownLaneInterval = 330;
const short kFeatureUdLineNum = 150;
const short kFeatureDownLineNo = 500;
const short kFeatureDLaneWidthMin = 5;
const short kFeatureDLaneWidthMax = 50;

const float kPmFeatureTimesWidth = 2.5;
const short kPmFeatureNmFiledLineNum = 25;
const float kPmFeatureInputHigh = 6.0;
const float kPmFeatureInputMiddle = 8.0;
const float kPmFeatureInputLow = 10.0;

// Hough or cluster
const short kFitLineMinVote = 8;
const float kFitLineMinLength = 10.0;
const float kFitLineMaxGap = 30.0;
const short kFitMaxHoughCount = 20;

// fitting
const float kFitLimitRho = 20.0;
const float kControlMinRho = 30;
const short kFitInitWidth[4] = {0, 20, 30, 40};

// EKF
const short kEkfCancelTime = 5;
const short kEkfGoodTime = 2;
const short kEkfBadTime = 5;

// show limit
const short kRefineMaxLeftCount = 1;
const short kRefineMaxRightCount = 1;
const short kRefineQuality = 1;
const float kRefineLaneWidth = 100;

const short kNumEkf = 30;
const float kErrorZero = 1e-6;

} /* namespace rmd */

#endif /* SRC_PARAMETER_H_ */
